package com.example.login.domain.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class EmployeeRegisterDTO {
    // 手机号
    @NotBlank(message = "手机号不能为null、空字符串和空白串")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式错误")
    @Schema(description ="手机号")
    private String phone;

    // 密码
    @Schema(description ="密码")
    @Pattern(regexp = "^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{6,20}$", message = "密码至少包含一个字母和一个数字，长度为6-20位")
    private String password;

    // 验证码
    @Schema(description ="验证码")
    @Size(min = 6, max = 6, message = "验证码长度为6")
    private String captcha;
}
